package org.shj.ws;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import lombok.extern.slf4j.Slf4j;

/**
 * @author Shen Huang Jian
 * @date 2020-07-28 16:21
 */
public class XmlUtil {

    public static ResponseInfo parseMessageFromWs(String responseXml){
        ResponseInfo responseInfo = new ResponseInfo();
        ObjectMapper mapper = new XmlMapper();

        try {
            responseInfo = mapper.readValue(responseXml, ResponseInfo.class);

        }catch (Exception e){
            e.printStackTrace();
        }
        return responseInfo;
    }
}
